package com.link2room.rodimus.entity;

import com.link2room.common.entity.BaseEntity;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.sql.Timestamp;
import java.util.Date;

/**
 * Created by LN on 2017/12/5
 */
@Entity
@Table(name = "group_buying_team")
public class GroupBuyingTeamEntity extends BaseEntity {
    public enum GroupBuyingTeamEntity_{
        teamCode,sta,groupBuyingCode
    }
    private String teamCode;
    private Date startDatetime;
    private Date endDatetime;
    private String groupBuyingCode;
    private String groupBuyingName;
    private Integer numMember;
    private Integer numParticipant;
    private String sta;
    private String captainOpenid;
    private String captainHeadUrl;
    private String captainNickName;
    private String memberNo;
    private String remark;

    @Basic
    @Column(name = "team_code")
    public String getTeamCode() {
        return teamCode;
    }

    public void setTeamCode(String teamCode) {
        this.teamCode = teamCode;
    }

    @Basic
    @Column(name = "start_datetime")
    public Date getStartDatetime() {
        return startDatetime;
    }

    public void setStartDatetime(Date startDatetime) {
        this.startDatetime = startDatetime;
    }

    @Basic
    @Column(name = "end_datetime")
    public Date getEndDatetime() {
        return endDatetime;
    }

    public void setEndDatetime(Date endDatetime) {
        this.endDatetime = endDatetime;
    }

    @Basic
    @Column(name = "group_buying_code")
    public String getGroupBuyingCode() {
        return groupBuyingCode;
    }

    public void setGroupBuyingCode(String groupBuyingCode) {
        this.groupBuyingCode = groupBuyingCode;
    }


    @Basic
    @Column(name = "group_buying_name")
    public String getGroupBuyingName() {
        return groupBuyingName;
    }

    public void setGroupBuyingName(String groupBuyingName) {
        this.groupBuyingName = groupBuyingName;
    }

    @Basic
    @Column(name = "num_member")
    public Integer getNumMember() {
        return numMember;
    }

    public void setNumMember(Integer numMember) {
        this.numMember = numMember;
    }

    @Basic
    @Column(name = "num_participant")
    public Integer getNumParticipant() {
        return numParticipant;
    }

    public void setNumParticipant(Integer numParticipant) {
        this.numParticipant = numParticipant;
    }

    @Basic
    @Column(name = "sta")
    public String getSta() {
        return sta;
    }

    public void setSta(String sta) {
        this.sta = sta;
    }

    @Basic
    @Column(name = "captain_openid")
    public String getCaptainOpenid() {
        return captainOpenid;
    }

    public void setCaptainOpenid(String captainOpenid) {
        this.captainOpenid = captainOpenid;
    }

    @Basic
    @Column(name = "captain_head_url")
    public String getCaptainHeadUrl() {
        return captainHeadUrl;
    }

    public void setCaptainHeadUrl(String captainHeadUrl) {
        this.captainHeadUrl = captainHeadUrl;
    }

    @Basic
    @Column(name = "captain_nick_name")
    public String getCaptainNickName() {
        return captainNickName;
    }

    public void setCaptainNickName(String captainNickName) {
        this.captainNickName = captainNickName;
    }

    @Basic
    @Column(name = "member_no")
    public String getMemberNo() {
        return memberNo;
    }

    public void setMemberNo(String memberNo) {
        this.memberNo = memberNo;
    }
    @Basic
    @Column(name = "remark")
    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        GroupBuyingTeamEntity that = (GroupBuyingTeamEntity) o;

        if (teamCode != null ? !teamCode.equals(that.teamCode) : that.teamCode != null) return false;
        if (startDatetime != null ? !startDatetime.equals(that.startDatetime) : that.startDatetime != null)
            return false;
        if (endDatetime != null ? !endDatetime.equals(that.endDatetime) : that.endDatetime != null) return false;
        if (groupBuyingCode != null ? !groupBuyingCode.equals(that.groupBuyingCode) : that.groupBuyingCode != null)
            return false;
        if (groupBuyingName != null ? !groupBuyingName.equals(that.groupBuyingName) : that.groupBuyingName != null)
            return false;
        if (numMember != null ? !numMember.equals(that.numMember) : that.numMember != null) return false;
        if (numParticipant != null ? !numParticipant.equals(that.numParticipant) : that.numParticipant != null)
            return false;
        if (sta != null ? !sta.equals(that.sta) : that.sta != null) return false;
        if (captainOpenid != null ? !captainOpenid.equals(that.captainOpenid) : that.captainOpenid != null)
            return false;
        if (captainHeadUrl != null ? !captainHeadUrl.equals(that.captainHeadUrl) : that.captainHeadUrl != null)
            return false;
        if (captainNickName != null ? !captainNickName.equals(that.captainNickName) : that.captainNickName != null)
            return false;
        if (memberNo != null ? !memberNo.equals(that.memberNo) : that.memberNo != null) return false;
        return remark != null ? remark.equals(that.remark) : that.remark == null;
    }

    @Override
    public int hashCode() {
        int result = teamCode != null ? teamCode.hashCode() : 0;
        result = 31 * result + (startDatetime != null ? startDatetime.hashCode() : 0);
        result = 31 * result + (endDatetime != null ? endDatetime.hashCode() : 0);
        result = 31 * result + (groupBuyingCode != null ? groupBuyingCode.hashCode() : 0);
        result = 31 * result + (groupBuyingName != null ? groupBuyingName.hashCode() : 0);
        result = 31 * result + (numMember != null ? numMember.hashCode() : 0);
        result = 31 * result + (numParticipant != null ? numParticipant.hashCode() : 0);
        result = 31 * result + (sta != null ? sta.hashCode() : 0);
        result = 31 * result + (captainOpenid != null ? captainOpenid.hashCode() : 0);
        result = 31 * result + (captainHeadUrl != null ? captainHeadUrl.hashCode() : 0);
        result = 31 * result + (captainNickName != null ? captainNickName.hashCode() : 0);
        result = 31 * result + (memberNo != null ? memberNo.hashCode() : 0);
        result = 31 * result + (remark != null ? remark.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return "GroupBuyingTeamEntity{" +
                "teamCode='" + teamCode + '\'' +
                ", startDatetime=" + startDatetime +
                ", endDatetime=" + endDatetime +
                ", groupBuyingCode='" + groupBuyingCode + '\'' +
                ", groupBuyingName='" + groupBuyingName + '\'' +
                ", numMember=" + numMember +
                ", numParticipant=" + numParticipant +
                ", sta='" + sta + '\'' +
                ", captainOpenid='" + captainOpenid + '\'' +
                ", captainHeadUrl='" + captainHeadUrl + '\'' +
                ", captainNickName='" + captainNickName + '\'' +
                ", memberNo='" + memberNo + '\'' +
                ", remark='" + remark + '\'' +
                '}';
    }
}
